package day3;

import java.util.Random;
import java.util.Scanner;

public class suiji {

	public static void main(String[] args) {
		int randomNumber = new Random().nextInt(100) + 1;
		Scanner sc = new Scanner(System.in);
		while (true) {
			System.out.println("猜吧！");
			System.out.println("如果想退出请按0，任意键继续");
			Scanner s = new Scanner(System.in);
			int quit = s.nextInt();
			if (quit == 0) {
				break;
			}
			int num = sc.nextInt();
			if (num > randomNumber) {
				System.out.println("太大了");
			} else if (num < randomNumber) {
				System.out.println("太小了");
			} else {
				System.out.println("猜对了");
				// 退出当前循环，只能退出一层循环
				break;
			}
		}
	}
}
